package com.mkono.infra.untils;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * 用作缓存数据
 * Created by HUANG on 2020/3/2.
 */

public class UserUtil {

    /**
     * ����groupName
     *
     * @param context
     * @param userAgree
     */
    public static void setUserAgree(Context context, boolean userAgree) {
        SharedPreferences sp = context.getSharedPreferences("app",
                Context.MODE_PRIVATE);
        SharedPreferences.Editor edit = sp.edit();
        edit.putBoolean("userAgree", userAgree);
        edit.commit();
    }

    /**
     * ȡ��groupName
     *
     * @param context
     * @return
     */
    public static boolean getUserAgree(Context context) {
        SharedPreferences sp = context.getSharedPreferences("app",
                Context.MODE_PRIVATE);
        boolean userAgree = sp.getBoolean("userAgree", false);
        return userAgree;
    }
}
